package neuralmusic.brain.module;


public class TimeComparable implements Comparable<TimeComparable>  {
	
	protected double when;       // time we want to fire
	
	public TimeComparable(){
	}
		
	

	final public int compareTo(TimeComparable o) {
		double i = when;
		double j = ((TimeComparable)o).when;
		if (i < j) {
			return -1;
		}
		if (i > j) {
			return 1;
		}
		
		double ii = hashCode();
		double jj = ((TimeComparable)o).hashCode();
		if (ii < jj) {
			return -1;
		}
		if (ii > jj) {
			return 1;
		}
		return 0;
	}

	public double getWhen() {
		return when;
	}
}
